package dao.pojo;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Comments entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "comments", catalog = "onlinemall")
public class Comments implements java.io.Serializable {

	// Fields

	private Integer commentsId;
	private MemberInfo memberInfo;
	private OrderCommodityInfo orderCommodityInfo;
	private String commentsContent;
	private Timestamp commentsTime;

	// Constructors

	/** default constructor */
	public Comments() {
	}

	/** full constructor */
	public Comments(Integer commentsId, MemberInfo memberInfo,
			OrderCommodityInfo orderCommodityInfo, String commentsContent,
			Timestamp commentsTime) {
		this.commentsId = commentsId;
		this.memberInfo = memberInfo;
		this.orderCommodityInfo = orderCommodityInfo;
		this.commentsContent = commentsContent;
		this.commentsTime = commentsTime;
	}

	// Property accessors
	@Id
	@Column(name = "comments_id", unique = true, nullable = false)
	public Integer getCommentsId() {
		return this.commentsId;
	}

	public void setCommentsId(Integer commentsId) {
		this.commentsId = commentsId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "member_id", nullable = false)
	public MemberInfo getMemberInfo() {
		return this.memberInfo;
	}

	public void setMemberInfo(MemberInfo memberInfo) {
		this.memberInfo = memberInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "order_commodity_id", nullable = false)
	public OrderCommodityInfo getOrderCommodityInfo() {
		return this.orderCommodityInfo;
	}

	public void setOrderCommodityInfo(OrderCommodityInfo orderCommodityInfo) {
		this.orderCommodityInfo = orderCommodityInfo;
	}

	@Column(name = "comments_content", nullable = false, length = 65535)
	public String getCommentsContent() {
		return this.commentsContent;
	}

	public void setCommentsContent(String commentsContent) {
		this.commentsContent = commentsContent;
	}

	@Column(name = "comments_time", nullable = false, length = 19)
	public Timestamp getCommentsTime() {
		return this.commentsTime;
	}

	public void setCommentsTime(Timestamp commentsTime) {
		this.commentsTime = commentsTime;
	}

}